/**
 * 
 */
package com.typhoon.spring_shiro.service.shiro;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.LogoutFilter;

/**
 * 退出登录管理
 * 
 * @author Typhoon
 */
public class CustomLogoutFilter extends LogoutFilter {

	//private String ajisenLoginUrl = "/ajisen_login";

	protected String getRedirectUrl(ServletRequest req, ServletResponse res, Subject subject) {

		HttpServletRequest request = (HttpServletRequest) req;
		HttpServletResponse response = (HttpServletResponse) res;
		String loginServer = "";//TODO
//		String loginServer = SysConfigConstants.getProperty("saofu_bossapp_server_url");
//
//		String redirectUrl = getRedirectUrl();
//
//		// 味千门店分公司登陆
//		Cookie ajisenCookie = CookieUtil.getCookieByName(request, WebConstants.AJISEN_COOKIE_KEY);
//		if (ajisenCookie != null && StringUtils.equals(ajisenCookie.getValue(), WebConstants.AJISEN_COOKIE_KEY)) {
//			redirectUrl = ajisenLoginUrl;
//		} else {
//			CookieUtil.removeCookie(response, WebConstants.AJISEN_COOKIE_KEY);
//		}

		return loginServer + getRedirectUrl(request, response, subject);
	}
}
